package com.Web.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;


@WebFilter("/*")//拦截所有
public class Afilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//      模拟操作处理
        System.out.println("Afilter is not running....");
//        放行
        filterChain.doFilter(servletRequest,servletResponse);
        System.out.println("Afilter is running....");

    }

    @Override
    public void destroy() {

    }
}
